<?php

class Application_Form_Contact extends Frames_Form
{
    public function init()
    {
    	$id = new Zend_Form_Element_Hidden('id');
    	$this->addElement($id);
    	
    	$name = new Zend_Form_Element_Text('name');
		$name->setRequired(true)
				->addValidator('stringLength', false, array(2,48))
		         ->setLabel(  'שם ושם משפחה:' )
		         ->addFilter('StringToLower')
		          ->addFilter('StringTrim')
		           ->addFilter('StripTags')
		         ->setErrorMessages(array( 'השדה הינו שדה חובה' ));
		$this->addElement($name);
		
		$email = new Zend_Form_Element_Text('email');
		$email->setRequired(true)
				->addValidator('stringLength', false, array(2,48))
		         ->setLabel(  'כתובת דוא"ל:' )
		         ->addFilter('StringToLower')
		          ->addFilter('StringTrim')
		           ->addFilter('StripTags')
		         ->setErrorMessages(array( 'כתובת אימייל אינה חוקית' ));
		$this->addElement($email);
		
		$subject = new Zend_Form_Element_Text('subject');
		$subject->setRequired(true)
				->addValidator('stringLength', false, array(5, 98))
		         ->setLabel(  'נושא:' )
		         ->addFilter('StringToLower')
		          ->addFilter('StringTrim')
		           ->addFilter('StripTags')
		         ->setErrorMessages(array( 'השדה הינו שדה חובה' ));
		$this->addElement($subject);
		
	
		$content = new Zend_Form_Element_Textarea('content');
		$content->setRequired(true)->setAttrib('rows', 10)->setAttrib('cols', 30)
				->addValidator('stringLength', false, array(10, 495))
		         ->setLabel(  'תוכן הפניה:' )
		         ->addFilter('StringToLower')
		          ->addFilter('StringTrim')
		           ->addFilter('StripTags')
		         ->setErrorMessages(array( 'השדה הינו שדה חובה' ));
		$this->addElement($content);
	/*	
		$this->getView()->addHelperPath("Frames/View/Helper", "Frames_View_Helper");
		$primaryPhone = new Frames_Form_Element_Phone('phone');
		$primaryPhone->setLabel("מס' טלפון : ")
	  ->setAttrib('class' ,'some class' )
	  ->setAttrib('codeLength' ,'3' )
	  ->setAttrib('separator' ,' - ' )  // Separator between Phone number parts
	  ->setAttrib('ignoreSeparator', true)  // Ignore seperators from in field value
	  ->setDescription('Phone number format: XXX # XXXX # XXXXXX')
	 // ->setValue(isset($data['primary_phone']) ? $data['primary_phone'] : '')
	  ->addValidator('digits');
*
$this->addElement($primaryPhone);
*/
		parent::init( $this->legendLabel );
		
		

       /* // Set the method for the display form to POST
 
        $primaryPhone = new Frames_Form_Element_Phone('primary_phone');

/*$primaryPhone->setLabel('Primary phone')
	  ->setAtt
              // Add the comment element
 rib('class' ,'some class' )
	  ->setAttrib('codeLength' ,'3' )
	  ->setAttrib('separator' ,'#' )  // Separator between Phone number parts
	  ->setAttrib('ignoreSeparator', true)  // Ignore seperators from in field value
	  ->setDescription('Phone number format: XXX # XXXX # XXXXXX')
	 // ->setValue(isset($data['primary_phone']) ? $data['primary_phone'] : '')
	  ->addValidator('digits');

$this->addElement($primaryPhone);
        // Add an email element
        
     
 
        // Add the submit button
        $this->addElement('submit', 'submit', array(
            'ignore'   => true,
            'label'    => 'שלח',
        ));
 
        // And finally add some CSRF protection
        $this->addElement('hash', 'csrf', array(
            'ignore' => true,
        ));*/
    }
}